package com.csaba.connector.model;

/**
 * Specific type is defined for banks that can be target of transfers.
 * The name "Bank" is allocated for {@link Bank} class, that is for
 * Bank that is service provider for Csaba.
 * 
 * @author Gabe
 *
 */
public class PartnerBank extends AbstractRemoteObject
{
	private static final long serialVersionUID = 313714875304156840L;

	private String name;
	private String bankCode;
	private String swiftCode;
	private Country country;
	private String address;

	public String getName()
	{
		return name;
	}

	public void setName( final String name )
	{
		this.name = name;
	}

	public String getBankCode()
	{
		return bankCode;
	}

	public void setBankCode( final String bankCode )
	{
		this.bankCode = bankCode;
	}

	public String getSwiftCode()
	{
		return swiftCode;
	}

	public void setSwiftCode( final String swiftCode )
	{
		this.swiftCode = swiftCode;
	}

	public Country getCountry()
	{
		return country;
	}

	public void setCountry( final Country country )
	{
		this.country = country;
	}

	public String getAddress()
	{
		return address;
	}

	public void setAddress( final String address )
	{
		this.address = address;
	}

	@Override
	public String toString()
	{
		return name + "[" + swiftCode + "]";
	}

	@Override
	public boolean equals( final Object obj )
	{
		if ( obj != null && obj instanceof PartnerBank )
		{
			final PartnerBank other = (PartnerBank) obj;
			return country.equals(other.country)
					&& ( bankCode != null ? bankCode.equals(other.bankCode) : swiftCode.equals(other.swiftCode) );
		}
		return false;
	}
}
